<?php echo $this->Session->flash(); ?>
<script>

    $(document).ready(function(){
        selectDiv();
        $('#tipo1').change(function() {
            selectDiv();


        });


    });
    
    function selectDiv(){
        
        if($('#tipo1 option:selected').val()=='Otra'){
            $('#cual1').show("slow");
            
        }else{
            $('#cual1').hide("slow");
            $('#WaterPollOtroCual').attr('value','');
        }
        
    } 

</script>
<div  id="loadvc" style="display: none;">
    <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
</div>

<?php echo $form->create('ProductiveVocations', array('action' => 'add')); ?>
<?php echo $form->hidden("ProductiveVocation.poll_id"); ?>
<?php echo $form->input("ProductiveVocation.tipo", array('options' => array('' => 'Seleccione', 'Agrícola' => 'Agrícola', 'Pecuaria' => 'Pecuaria', 'Forestal' => 'Forestal', 'Acuícola' => 'Acuícola', 'Otra' => 'Otra'), 'label' => 'Vocacion', 'id' => 'tipo1')); ?>
<div  id="cual1" style="display: none;">
    <?php echo $form->input("ProductiveVocation.otro_cual"); ?>
</div>
<?php echo $form->input("ProductiveVocation.hectareas"); ?>

<?php echo $ajax->submit('Guardar', array('url' => array('controller' => 'ProductiveVocations', 'action' => 'add', $this->data['ProductiveVocation']['poll_id']), 'update' => 'vocacion', 'indicator' => 'loadvc')); ?>
<?php echo $form->end(); ?>